﻿@model Alma.Models.ComparatorModel
@{
    ViewContext.Controller.ViewBag.Breadcrumb.Enter("Comparateur");
}
<div class="fullcol">
    <h1>Comparateur</h1>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <!--@using (Html.BeginForm())
        {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Comparer des produits</legend>

       <div class="editor-label">
            @Html.LabelFor(model => model.product1)
        </div>
        <div class="editor-field">
            Html.DropDownListFor(model => model.product1, (ViewData["drop1"] as SelectList), "- PRODUCT -")
            Html.ValidationMessageFor(model => model.product1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.product2)
        </div>
        <div class="editor-field">
            Html.DropDownListFor(model => model.product2, (ViewData["drop2"] as SelectList), "- PRODUCT -")
            Html.ValidationMessageFor(model => model.product2)
        </div>

        <p>
            <input type="submit" value="Comparer" />
        </p>
    </fieldset>
        }-->
    @if (Model.productList.Count == 0)
    {
        <p>
            Aucun produit dans le comparateur.</p>
    }
    else
    {
        <table>
            <tr>
                <th>
                    Nom
                </th>
                @foreach (var se in Model.productList)
                {
                    <th>@Html.ActionLink(se.Name, "Show", "Product", new { id = se.ID }, null)
                    </th>
                }
            </tr>
            <tr>
                <th>
                    Image
                </th>
                @foreach (var se in Model.productList)
                {
                    <td>
                        <div class="boxes">
                            <img alt="Product Illustration" class="productImg" src="@Url.Content(se.ImgUrl)" /></div>
                    </td>
                }
            </tr>
            <tr>
                <th>
                    Description
                </th>
                @foreach (var se in Model.productList)
                {
                    <td>@se.Description
                    </td>
                }
            </tr>
            @*
<tr><th>Critères</th>
@foreach (var se in Model.productList)
{
 <td>
 @foreach (var crit in se.CriterionList)
 {
     @crit.Item1 @crit.Item2 @crit.Item3<br />
 }
 </td>
}
</tr>*@
            @foreach (var crit in Model.Criterions)
            {
                <tr>
                    <th>@crit.Name (@crit.Unity)
                    </th>
                    @foreach (var val in crit.Values)
                    {
                        <td>@val
                        </td>
                    }
                </tr>
            }
            <tr>
                <th>
                </th>
                @foreach (var se in Model.productList)
                {
                    <td>@Html.ActionLink("Retirer", "Delete", "Comparator", new { id = se.ID }, null) |
                        @Html.ActionLink("Ajouter au Panier", "Add", "Cart", new { id = se.ID }, null)
                    </td>
                }
            </tr>
        </table>
        @Html.ActionLink("Vider le comparateur", "Free", "Comparator")
    }
</div>
